TreeGrid Cells Tutorial
4. Space Buttons and Tabs
Space action buttons, radios, tabs, combos, popups
-
Button
type shows action button with many features, used mostly in Space rows.
-
Clickable button
- after click there is called predefined action.
The button can be HTML text, <button> tag, icon or HTML text with icon.
The button type set by Button attribute, the icon file by Icon attribute.
The button text (if any) set in cell value.
After click to button is called XML event OnClick.
The button can be (temporary) disabled by Disabled attribute and hidden by Visible attribute.
-
Switch button
- button with two states on / off - after click it switches to the other state and is called predefined action.
The Switch button is set by Switch='1'.
The button value is button state 0 or 1.
The button texts are defined by ButtonText and ButtonTextChecked attributes.
The button icons are defined by Icon and IconChecked attributes.
After check are called XML events OnCheck and OnChange, after uncheck are called OnUncheck and OnSave.
-
Radio / tab button
- group of switch buttons – after click to one button in group the other buttons are automatically switched off.
The Radio button is set by Switch='1' and Radio='group', where the group is number of group the button belongs to.
Set Uncheck='1' to let the button uncheck by clicking it - to permit all buttons in group unchecked.
The Radio button can be displayed as Tab when set Button='Tab', it is just visual effect, behavior is the same.
All other attributes are the same as for Switch button.
-
Menu button
- after click to button is displayed popup menu and user selects one action from the list.
The menu is defined by List attribute, the first character separated array of the item names.
Icons for the items can be defined in Icons attribute.
After click is called action for clicked item from Actions attribute.
The List attribute can also contain complete TreeGrid menu definition, with collapsible levels, submenus, OnClick handlers and so on.
It is also possible to reload the grid with new source xml attached to the clicked item from attribute ReloadData.
-
Combo switch button
- a user selects button state from its popup menu, for the selected state is called assigned action.
The Combo switch button is defined Switch='1' and List. It behaves similarly to other combo types like Select or Enum, it has mainly different look.
After change is called XML event OnChange.
-
Combo radio / tab button
- a group of combo switch buttons, after change some button state, the other buttons are reset to its predefined empty value.
Combined the Radio with Combo, when defined Switch, Radio and List. In one group can be combined both standard Radio and Radio combos.
The off value is defined by EmptyValue attribute, the off icon by EmptyIcon attribute. The off value is selected whenever user selects another Radio or Combo in the group.
-
In Space row is possible to use also any other cell types and attributes like in standard data row.
You often need to specify Width of the cell, because many types don't calculate the width automatically.